Available data on Makay protected area

Author

Florent Bédécarrats

Introduction

This interactive workbook aims at providing an overview of data sources that are potentially relevant for the analysis of economic, social and ecological dynamics in the area concerned by the creation of the Makay protected area.

Working environment

We use R and a series of packages dedicated to spatial data and analysis.

Code
library(aws.s3)
library(tidyverse) # toolkit for data manipulation
library(geodata) # to get municipalities
library(sf) # to handle spatial data (vectors)
library(terra) # to handle patial data (rasters)
library(mapme.biodiversity) # to compute spatial indicators
library(tmap) # nice maps
library(zoo) # time series
library(units) # ensures units are right
library(future) # to parallelize computations
library(exactextractr) # engine for mapme.biodiversity
library(SPEI) # to compute rainfall  

Makay protected area

We load the Makay protected area boundaries.

Code
makay_ap <- st_read("data/Makay_wgs84.geojson", quiet = TRUE) %>%
  rename(Statut = SOURCETHM) %>%
  mutate(Statut = recode(Statut, "zone tampon" = "Zone tampon"))

# Fist we dissolve the different areas
makay_union <- makay_ap %>%
  st_union() %>%
  st_sf() %>%
  st_make_valid()

# Draw map
tmap_mode("view")
tm_shape(makay_ap) +
  tm_polygons(col = "Statut", alpha = 0.5) +
  tm_shape(makay_union) +
  tm_borders(col = "red") + 
  tm_add_legend(type = "fill", col = "red", labels = "Limite externe") +
  tm_basemap("OpenStreetMap")

Makay protected area (source: Auréa?)

The protected area is composted of five polygons with different status: four polygons are cores, and one polygon is a buffer area.

Administrative areas

We will now select all municipalities located within a 20km distance from the outer border of the Makay protected area (core or buffer zone).

Code
buff_size <- 20
# Create a 20km buffer around Makay PA
makay_ext_buffer <- makay_union %>%
  st_buffer(dist = set_units(buff_size, km)) %>%
  st_as_sf()
# Download Madagascar municipalities
muni_mada <- gadm("MDG", level  =4, path = "data") %>%
  st_as_sf() %>%
  rename(Nom_province = NAME_1, Nom_region = NAME_2, Nom_district = NAME_3,
         Nom_commune = NAME_4)
# Select municipalities that intersect the buffer
muni_makay <- muni_mada %>%
  st_filter(makay_union, .predicate = st_intersects)
muni_makay_names <- pluck(muni_makay, "Nom_commune")
muni_around_makay <- muni_mada %>%
  st_filter(makay_ext_buffer, .predicate = st_intersects)
muni_around_makay_names <- pluck(muni_around_makay, "Nom_commune")
muni_makay <- muni_mada %>%
  st_filter(makay_union, .predicate = st_intersects)

muni_around_ext_makay <- muni_around_makay_names[!(muni_around_makay_names %in% 
                                                     muni_makay_names)]

# Draw map
tm_shape(makay_union) +
  tm_borders(col = "red") + 
  tm_shape(muni_around_makay) + 
  tm_borders(col = "blue") +
  tm_fill(alpha = 0, id = "Nom_commune", 
          popup.vars = c("Nom_commune","Nom_district", "Nom_region", 
                         "Nom_province")) +
  tm_basemap("OpenStreetMap")

Surrounding municipalities (source: GADM)

There are 13 municipalities that directly overlap with Makay: Tandrano, Beroroha, Fanjakana, Mandronarivo, Marerano, Sakena, Tanamary, Ambia, Ankilizato, Beronono, Malaimbandy, Mandabe, Tsimazava. There are 4 municipalities that do not directly overlap with Makay PA but are located within a 20 km radius from Makay PA: Mandrosonoro, Fitampito, Behisatra, Beharona.

Rainfall

We use the CHIRPS data from NASA to estimate 3 day average rainfall on the Makay protected area.The source data has a spatial resolution of 0.05° (about 5km). We compute the data using the package mapme.biodiversity (Görgen and Bhandari 2023).

Code
# We group Makay PA zones and communes to have an object with all areas of interest
# We keep only one common field "name"
aoi <- bind_rows(
  filter(makay_ap, Statut == "Zone tampon"),
  filter(makay_ap, Statut == "Noyau dur") %>% 
    mutate(Statut = paste0(Statut, "_", 1:4))) %>%
  select(name = Statut) %>%
  bind_rows(
    mutate(makay_union, name = "Ensemble")) %>%
  mutate(name = paste0("AP Makay : ", name)) %>%
  bind_rows(select(muni_around_makay, name = Nom_commune)) %>%
  st_cast("POLYGON")

# we use parallel computing to reduce processing time
plan(multisession, workers = 8)

# Reference portfolio (chirps data was loaded at startup)
aoi <- init_portfolio(aoi, years = 1990:2020,
                      outdir = "data") 


aoi_1 <- s3read_using(FUN = read_rds, object = "partage/makay/aoi_1.rds",
                      bucket = "fbedecarrats", opts = list("region" = ""))

if (!exists("aoi_1")) {
  aoi <- aoi %>%
  get_resources("chirps")
  # Compute precipitation
  aoi_1 <- aoi %>%
    calc_indicators("precipitation_chirps",
                    engine = "exactextract",
                    scales_spi = 3,
                    spi_prev_years = 8)
  s3write_using(aoi_1, FUN = write_rds, object = "partage/makay/aoi_1.rds",
                bucket = "fbedecarrats", opts = list("region" = ""))
}

# We compute 3d average precipitations
precip_3d <- aoi_1 %>%
  unnest(precipitation_chirps) %>%
  group_by(name) %>%
  mutate(rainfall_3d_mean = rollmean(absolute, k = 3, fill = NA))

# We display precipitations for Makay area
precip_3d %>%
  filter(name == "AP Makay : Ensemble") %>%
  ggplot(aes(x = dates, y = rainfall_3d_mean)) +
  geom_line()

Rainfalls on Makay PA (source : CHIRPS, 3 day rolling average)

Cyclones

We use the Tropical cyclone best track data (IBTrACS) to get history of cyclone trajectories and cyclone attributes (Knapp et al. 2010), as well as raw code from (Schielein 2023).

Code
if (!file.exists("data/ibtracs/IBTrACS.since1980.list.v04r00.lines.shp")) {
  dir.create("data/ibtracs")
  download.file(url = "https://www.ncei.noaa.gov/data/international-best-track-archive-for-climate-stewardship-ibtracs/v04r00/access/shapefile/IBTrACS.since1980.list.v04r00.lines.zip", 
                destfile = "data/ibtracs/ibtracs_lines.zip")
  unzip("data/ibtracs/ibtracs_lines.zip", exdir = "data/ibtracs")
}

mada <- gadm("MDG", level=0, path = "data") %>%
  st_as_sf()

# column description is given here: https://www.ncei.noaa.gov/sites/default/files/2021-07/IBTrACS_v04_column_documentation.pdf
cyclones <- read_sf("data/ibtracs/IBTrACS.since1980.list.v04r00.lines.shp")

# Create a buffer 300km around Madagascar
mada_buff <- st_buffer(mada, 300)

cyclones$wind_combined <- cyclones %>%
  select(contains("WIND")) %>%
  select(-WMO_WIND) %>%
  st_drop_geometry() %>%
  rowMeans(., na.rm = T)

cyclones_mada <- cyclones %>%
  st_intersection(mada_buff) %>%
  select(Season = SEASON, Name = NAME, Winds_in_knots = wind_combined)

tm_shape(makay_union) + 
  tm_borders(col = "red") + 
  tm_shape(cyclones_mada) +
  tm_lines(col = "Season", lwd = "Winds_in_knots", scale = 3, palette = "Blues",
           popup.vars = c("Name", "Season", "Winds in knots" = "Winds_in_knots"),
           legend.format = list(big.mark=""), popup.format = list(big.mark=""))

Cyclone trajectories, dates and intensity (source: IBTrACS)

The map shows that the Makay protected area has been hit by a number of significant cyclones. Most notably, Freddy in 2023 and Bastiraï in 2022, both with winds of around 57 knots (1 knot = 1.825 km/h). Lesser cyclones had hit the area in previous years: Chedza in 2014 (winds around 42 knots), Elita in 2005 (winds around 52 knots).

Fires

This analysis is based on the example produced by Darius Goergen on the Mapme website.

Code
aoi_2 <- get_resources(aoi_1, "nasa_firms", instrument = "MODIS")

gpkgs <- list.files(file.path("data", "nasa_firms"),
                    pattern = ".gpkg", full.names = TRUE)
nasa_firms <- map_dfr(gpkgs, function(x) {
  read_sf(x, wkt_filter = st_as_text(st_as_sfc(st_bbox(aoi_2))))
})
nasa_firms <- nasa_firms[unlist(st_contains(aoi_2, nasa_firms)), ]
nasa_firms <- filter(nasa_firms, confidence > 50)
nasa_firms$year <- as.factor(year(nasa_firms$acq_date))
# Remove year 2000 for visibility
nasa_firms <- filter(nasa_firms, year != "2000")

tmap_mode("plot")

tm_shape(nasa_firms) +
  tm_dots(col = "darkorange", alpha = 0.1) + 
  tm_facets(by = "year", nrow = 5, ncol = 4) +
  tm_shape(makay_union) + 
  tm_borders(col = "red")

Fires in and around Makay PA (source: MODIS)

Droughts

Conflicts

We use here the data for all type of conflicts from ACLED (Armed Conflict Location & Event Data Project (ACLED); www.acleddata.com), accessed on August 17th, 2023. ACLED data records violent events registered between 1997 and today. We spatially filter this data over the period of interest to keep only the occurrences in the 17 municipalities above.

Species occurrences

Use of the GBIF data.

References

Görgen, Darius A., and Om Prakash Bhandari. 2023. “Mapme.biodiversity: Efficient Monitoring of Global Biodiversity Portfolios.”
Knapp, Kenneth R., Michael C. Kruk, David H. Levinson, Howard J. Diamond, and Charles J. Neumann. 2010. “The International Best Track Archive for Climate Stewardship (IBTrACS) Unifying Tropical Cyclone Data.” Bulletin of the American Meteorological Society 91 (3): 363–76.
Schielein, Johannes. 2023. “Mapme.protectedareas: Reproducible Processing and Analysis Routines with r to Assist in Planning Monitoring and Evaluation of Projects to Support PAs Worldwide.”